Skip to content

Zigbee Switch: Add support/handling for Stateless Step Capabilities#2818

Open
wkhenon wants to merge 3 commits intomainfrom
zigbee-switch/stateless-capabilities
Open

Zigbee Switch: Add support/handling for Stateless Step Capabilities#2818
wkhenon wants to merge 3 commits intomainfrom
zigbee-switch/stateless-capabilities

Conversation

@wkhenon
Copy link
Copy Markdown
Contributor

@wkhenon wkhenon commented Mar 2, 2026

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

@wkhenon wkhenon changed the base branch from main to feature/color_temp_range March 2, 2026 21:53
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

Test Results

   72 files    495 suites   0s ⏱️
2 713 tests 2 713 ✅ 0 💤 0 ❌
4 584 runs  4 584 ✅ 0 💤 0 ❌

Results for commit 3da9241.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 2, 2026

File Coverage
All files 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/configurations/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/frient/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua 90%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/preferences.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/color_temp_range_handlers/init.lua 77%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/inovelli/vzm30-sn/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/stateless_handlers/init.lua 89%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/frient-IO/unbind_request.lua 71%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-switch/src/frient-IO/init.lua 88%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 3da9241

@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch 2 times, most recently from 535962c to cf1fc47 Compare March 3, 2026 15:24
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 3, 2026

Duplicate profile check: Warning - duplicate profiles detected.
color-temp-bulb-2700K-6500K.yml == color-temp-bulb.yml

@greens greens force-pushed the feature/color_temp_range branch from 3d5baa4 to 8855768 Compare March 3, 2026 21:17
@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch 2 times, most recently from c0a48c5 to f4a7af9 Compare March 4, 2026 17:26
Base automatically changed from feature/color_temp_range to main March 4, 2026 19:07
@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch from f10a277 to 1bbafc5 Compare March 9, 2026 14:30
@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch from 1bbafc5 to 21d5850 Compare March 9, 2026 20:23
@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch from 4ad4ca3 to 75ef0dc Compare March 11, 2026 19:24
@wkhenon wkhenon force-pushed the zigbee-switch/stateless-capabilities branch from 671071f to 2023b46 Compare March 12, 2026 19:08
@hcarter-775 hcarter-775 force-pushed the zigbee-switch/stateless-capabilities branch from 2023b46 to 2a1d09d Compare March 26, 2026 18:40
switch_utils.KELVIN_MAX = "_max_kelvin"
switch_utils.KELVIN_MIN = "_min_kelvin"
switch_utils.MIREDS_CONVERSION_CONSTANT = 1000000
switch_utils.COLOR_TEMPERATURE_KELVIN_MAX = 15000
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to adjust these max/min's similar to what you did or were going to do for Matter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Matter change (seen here) does not actually alter the max/min values- only the defaults used as max and min for the step level.

One reason I haven't done that in this PR is because I'm not sure what the correct default should be. In matter there is a relatively clear default from my perspective, but not here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same range would be fine to use here. It's going to be closer to reality than 1000-15000

local function step_color_temperature_by_percent_handler(driver, device, cmd)
local step_percent_change = cmd.args and cmd.args.stepSize or 0
if step_percent_change == 0 then return end
local step_mode = step_percent_change > 0 and clusters.ColorControl.types.CcStepMode.DOWN or clusters.ColorControl.types.CcStepMode.UP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be helpful to add a comment here that a step up in Kelvin is a step down in mireds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants